package day12;

import java.util.Scanner;

public class math {
    public static void main(String[] args) {        //自幂数
        int n=0,temp;
        int[] arr=new int[10];
        Scanner sc=new Scanner(System.in);
        int num=sc.nextInt();
        temp=num;
        while(temp!=0){
            arr[n]=temp%10;
            temp=temp/10;
            n++;
        }
        int sum=0;
        for(int i=arr.length;i>0;i--){
            sum+=Math.pow(arr[i-1],n);
        }
        if(num==sum) System.out.println("Yes");
        else System.out.println("No");
    }
}
